#ifndef OVERVIEWCHART_H
#define OVERVIEWCHART_H

#include <QWidget>
#include "ndb.h"
#include <QObject>
#include "drilldownchart.h"
#include "drilldownslice.h"
#include <QtWidgets/QApplication>
#include <QtWidgets/QMainWindow>
#include <QtCore/QTime>
#include <QtCharts/QChartView>
#include <QtCharts/QLegend>
#include <QtCharts/QPieSeries>

#include "taskitem.h"
#include <QComboBox>

QT_CHARTS_USE_NAMESPACE

namespace Ui {
class OverviewChart;
}

using DtimePair = QPair<QDateTime, QDateTime>;


class OverviewChart : public QWidget
{
    Q_OBJECT

public:
    explicit OverviewChart(QWidget *parent = nullptr);
    ~OverviewChart();


    void initCombox();
    void ComboxDateTime(DtimePair &dtpair);
    void loadData(const QDateTime &startDatetime, const QDateTime &endDatetime);
    void drawPie(DtimePair &dtpair);
    void selectComboxIndex(int index);


private slots:
    void on_daysRangeCB_currentIndexChanged(int index);

private:
    Ui::OverviewChart *ui;

    QMap<int, QVector<QPair<QString, int>>> m_data_map;
};

#endif // OVERVIEWCHART_H
